<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>电路与二进制运算 | hez2010</title>
  
  
  
  <!--link rel="stylesheet" href="//cdn.jsdelivr.net/highlight.js/9.10.0/styles/github-gist.min.css"-->
  
<link rel="stylesheet" href="//cdn.jsdelivr.net/highlight.js/9.10.0/styles/github-gist.min.css">

  
<link rel="stylesheet" href="/css/style.css">

<!-- hexo injector head_end start -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/katex@0.12.0/dist/katex.min.css">

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/hexo-math@4.0.0/dist/style.css">
<!-- hexo injector head_end end --><meta name="generator" content="Hexo 5.1.1"></head>

<body>
<div class="Shell">
    <aside class='SideBar'>
    <section class='avatar' style="background-image: url()">
        <div class='av-pic' style="background-image: url(/assets/avatar.jpg)">
        </div>
    </section>
    <section class='menu'>
        <div>hez2010</div>
        
            <div>软件工程导论</div>
        
        <ul>
          
            <a href="/" class="Btn">
              <li>Home</li>
            </a>  
          
            <a href="/archives/" class="Btn">
              <li>Archive</li>
            </a>  
          
        </ul>
    </section>
    <section class="media">
        
            
                <a target="_blank" rel="noopener" href="https://github.com/hez2010">
                    <img src="/assets/github.svg" />
                </a>
            
        
    </section>
</aside>

    <div class="container">
        <div data-pager-shell>
            <div>
  <article class='ContentView'>
    <header class='PageTitle'>
        <h1>电路与二进制运算</h1>
    </header>

    <section>
      <h1 id="电路与二进制运算"><a href="#电路与二进制运算" class="headerlink" title="电路与二进制运算"></a>电路与二进制运算</h1><h2 id="案例说明"><a href="#案例说明" class="headerlink" title="案例说明"></a>案例说明</h2><h3 id="建立非门功能-O-A’-验证电路"><a href="#建立非门功能-O-A’-验证电路" class="headerlink" title="建立非门功能(O = A’)验证电路"></a>建立非门功能(O = A’)验证电路</h3><p><img src="/assets/circuit/1.png" alt="1.png"><br><img src="/assets/circuit/2.png" alt="2.png"></p>
<a id="more"></a>

<h3 id="真值表"><a href="#真值表" class="headerlink" title="真值表"></a>真值表</h3><table>
<thead>
<tr>
<th>INPUT(toggle switch)</th>
<th>OUTPUT(led)</th>
</tr>
</thead>
<tbody><tr>
<td>ON(1)</td>
<td>OFF(0)</td>
</tr>
<tr>
<td>OFF(0)</td>
<td>ON(1)</td>
</tr>
</tbody></table>
<h2 id="任务-1：建立一个简单电路"><a href="#任务-1：建立一个简单电路" class="headerlink" title="任务 1：建立一个简单电路"></a>任务 1：建立一个简单电路</h2><h3 id="设计与门验证电路"><a href="#设计与门验证电路" class="headerlink" title="设计与门验证电路"></a>设计与门验证电路</h3><p><img src="/assets/circuit/3.png" alt="3.png"></p>
<h3 id="画真值表验证与门功能"><a href="#画真值表验证与门功能" class="headerlink" title="画真值表验证与门功能"></a>画真值表验证与门功能</h3><table>
<thead>
<tr>
<th>In A</th>
<th>In B</th>
<th>Out</th>
</tr>
</thead>
<tbody><tr>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
</tbody></table>
<p><img src="/assets/circuit/4.png" alt="4.png"></p>
<p><img src="/assets/circuit/5.png" alt="5.png"></p>
<p><img src="/assets/circuit/6.png" alt="6.png"></p>
<p><img src="/assets/circuit/7.png" alt="7.png"></p>
<h3 id="如何用-XOR-门作非门"><a href="#如何用-XOR-门作非门" class="headerlink" title="如何用 XOR 门作非门"></a>如何用 XOR 门作非门</h3><p>将输入与高电平进行异或即可</p>
<h3 id="串联、并联三极管"><a href="#串联、并联三极管" class="headerlink" title="串联、并联三极管"></a>串联、并联三极管</h3><p>串联：与门，并联：或门</p>
<h2 id="任务-2：验证电路等价"><a href="#任务-2：验证电路等价" class="headerlink" title="任务 2：验证电路等价"></a>任务 2：验证电路等价</h2><h3 id="建立-A（B-C）和-AB-AC"><a href="#建立-A（B-C）和-AB-AC" class="headerlink" title="建立 A（B+C）和 AB+AC"></a>建立 A（B+C）和 AB+AC</h3><p><img src="/assets/circuit/8.png" alt="8.png"></p>
<h3 id="枚举所有可能输入，用真值表记录结果"><a href="#枚举所有可能输入，用真值表记录结果" class="headerlink" title="枚举所有可能输入，用真值表记录结果"></a>枚举所有可能输入，用真值表记录结果</h3><p><img src="/assets/circuit/9.png" alt="9.png"></p>
<p><img src="/assets/circuit/10.png" alt="10.png"></p>
<p><img src="/assets/circuit/11.png" alt="11.png"></p>
<p><img src="/assets/circuit/12.png" alt="12.png"></p>
<p><img src="/assets/circuit/13.png" alt="13.png"></p>
<p><img src="/assets/circuit/14.png" alt="14.png"></p>
<p><img src="/assets/circuit/15.png" alt="15.png"></p>
<p><img src="/assets/circuit/16.png" alt="16.png"></p>
<p>真值表：</p>
<table>
<thead>
<tr>
<th>A</th>
<th>B</th>
<th>C</th>
<th>O1</th>
<th>O2</th>
</tr>
</thead>
<tbody><tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
</tbody></table>
<p>因此两电路等价</p>
<h2 id="任务-3：理解存储电路"><a href="#任务-3：理解存储电路" class="headerlink" title="任务 3：理解存储电路"></a>任务 3：理解存储电路</h2><h3 id="按课件-S-R-latch-搭建电路"><a href="#按课件-S-R-latch-搭建电路" class="headerlink" title="按课件 S-R latch 搭建电路"></a>按课件 S-R latch 搭建电路</h3><p><img src="/assets/circuit/17.png" alt="17.png"></p>
<h3 id="顺序按Set，Reset，并填写真值表"><a href="#顺序按Set，Reset，并填写真值表" class="headerlink" title="顺序按Set，Reset，并填写真值表"></a>顺序按Set，Reset，并填写真值表</h3><p><img src="/assets/circuit/18.png" alt="18.png"></p>
<p><img src="/assets/circuit/19.png" alt="19.png"></p>
<p><img src="/assets/circuit/20.png" alt="20.png"></p>
<p><img src="/assets/circuit/21.png" alt="21.png"></p>
<p><img src="/assets/circuit/22.png" alt="22.png"></p>
<table>
<thead>
<tr>
<th>~Set</th>
<th>~Reset</th>
<th>Q（X）</th>
<th>~Q（Y）</th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
</tbody></table>
<h2 id="任务-4：设计全加电路"><a href="#任务-4：设计全加电路" class="headerlink" title="任务 4：设计全加电路"></a>任务 4：设计全加电路</h2><h3 id="画出一位的全加电路"><a href="#画出一位的全加电路" class="headerlink" title="画出一位的全加电路"></a>画出一位的全加电路</h3><p><img src="/assets/circuit/23.png" alt="23.png"></p>
<p>输入从上至下为 A、B、Cin，输出从左至右为 S、Cout</p>
<p>验证如下：</p>
<p><img src="/assets/circuit/24.png" alt="24.png"></p>
<p><img src="/assets/circuit/25.png" alt="25.png"></p>
<p><img src="/assets/circuit/26.png" alt="26.png"></p>
<p><img src="/assets/circuit/27.png" alt="27.png"></p>
<p><img src="/assets/circuit/28.png" alt="28.png"></p>
<p><img src="/assets/circuit/29.png" alt="29.png"></p>
<p><img src="/assets/circuit/30.png" alt="30.png"></p>
<p><img src="/assets/circuit/31.png" alt="31.png"></p>
<p>真值表：</p>
<table>
<thead>
<tr>
<th>A</th>
<th>B</th>
<th>Cin</th>
<th>S</th>
<th>Cout</th>
</tr>
</thead>
<tbody><tr>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>0</td>
<td>1</td>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
<td>0</td>
</tr>
<tr>
<td>1</td>
<td>0</td>
<td>1</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>0</td>
<td>0</td>
<td>1</td>
</tr>
<tr>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
<td>1</td>
</tr>
</tbody></table>
<h3 id="画出二位的全加电路"><a href="#画出二位的全加电路" class="headerlink" title="画出二位的全加电路"></a>画出二位的全加电路</h3><p>只需要两个一位全加器，并且将前一个全加器的 Count 连接至后一个全加器的 Cin 处即可。</p>
<p><img src="/assets/circuit/32.png" alt="32.png"></p>


      

    </section>
    
      <section class='ArticleMeta'>
          <div>
            发布于&nbsp;
            <time datetime="2020-10-12T13:03:44.635Z" itemprop="datePublished">
              2020-10-12
            </time>
          </div>
          
      </section>
    
    
</article>

  
</div>

            <footer>
    <div>© 2021 - Steven He </div>
    <div>
        <span>
            Powered by <a target="_blank" rel="noopener" href="https://hexo.io">Hexo</a>
        </span>
        ,
        <span>
            Theme - <a target="_blank" rel="noopener" href="https://github.com/nameoverflow/hexo-theme-icalm">Icalm</a>
        </span>
    </div>
</footer>

        </div>
    </div>
</div>

<script src="/js/pager/dist/singlepager.js"></script>

<script>
var sp = new Pager('data-pager-shell')

</script>
</body>
</html>